/*
 *    This program is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 3 of the License
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *    You should have received a copy of the GNU General Public License
 *    along with this program; if not, write to the Free Software Foundation,
 *    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 */

package JET.Actions;

import JET.Centers.ControlCenter;
import JET.Scene;
import org.w3c.dom.*;

/**
 *
 * @author 057Ry
 */
public abstract class Action {

    private String name;
    private double timeToLive;      // for how long this action will be called
                                    // in each main loop iteration

    public Action(String name) {
        this.name = name;
        timeToLive = 0.0;
    }

    protected void setTTL(double ttl) {
        timeToLive = ttl;
    }

    protected double getTTL() {
        return timeToLive;
    }

    public abstract void call();
    public abstract Element getXMLRepresentation(Document doc, Scene scene);

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public String toString() {
        return name;
    }
}
